package com.shd.day04;

import java.util.Arrays;
import java.util.stream.Stream;

/**
 * @author S5343
 * @date 2018年7月23日下午10:20:48
 */
public class StreamReduce {
	public static void main(String[] args) {
		Stream<Integer> stream = Arrays.stream(new Integer[] { -11, 2, 34, 5, 6 });
		// Integer reduce = stream.reduce(0, (i, j) -> i + j);
		Integer reduce = stream.reduce(0, Integer::sum);
		System.out.println(reduce);
	}
}
